package edu.fit5046.mymonashmate.activity;

import edu.fit5046.mymonashmate.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class LoginActivity extends Activity implements OnClickListener{

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		setContentView(R.layout.layout_login);
		Button loginButton = (Button)findViewById(R.id.button_login_login);
		Button registerButton = (Button)findViewById(R.id.button_login_register);
		loginButton.setOnClickListener(this);
		registerButton.setOnClickListener(this);
		super.onCreate(savedInstanceState);
	}

	@Override
	public void onClick(View view) {
		switch (view.getId()) {
		case R.id.button_login_login:
			login();
			break;

		case R.id.button_login_register:
			register();
			break;
		default:
			break;
		}
		
	}
	
	private void login() {
		Intent intent = new Intent();
		intent.setClass(this, MapActivity.class);
		startActivity(intent);
	}
	
	private void register() {
		Intent intent = new Intent();
		intent.setClass(this, RegisterActivity.class);
		startActivity(intent);
	}
	

}
